using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ClassesBasicas;
using Negocio;
using Interfaces;
using System.Data.SqlClient;

namespace Apresentacao
{
    public partial class CadastrarDepartamento : Form
    {
        public Form1 frm = new Form1();
        Negocio.CadastroDepartamento depto = new CadastroDepartamento();
        public CadastrarDepartamento()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Departamento de1 = new Departamento();
            //de1.Codigo = Int32.Parse(txtCodDepto.Text);
            de1.Nome = txtNomeDepto.Text;
            //Combobox de 
            //Chefe e Localidades
          
           //// de1.Localidades = comboBox1.SelectedValue;

            frm.depto.Inserir(de1);

            MessageBox.Show("Departamento Cadastrado com Sucesso");

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
          
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void CadastrarDepartamento_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'empresaFlareDataSet3.empregado' table. You can move, or remove it, as needed.
            this.empregadoTableAdapter1.Fill(this.empresaFlareDataSet3.empregado);
            // TODO: This line of code loads data into the 'empresaFlareDataSet2.empregado' table. You can move, or remove it, as needed.
            this.empregadoTableAdapter.Fill(this.empresaFlareDataSet2.empregado);
            // TODO: This line of code loads data into the 'empresaFlareDataSet1.localidade' table. You can move, or remove it, as needed.
            this.localidadeTableAdapter.Fill(this.empresaFlareDataSet1.localidade);

        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void txtNomeDepto_TextChanged(object sender, EventArgs e)
        {

        }
    }
}